# from tkinter import *
# import time
#
# times = int(input('请输入倒计时时间：（s）'))
#
#
# def gettime():
#     # 获取当前时间并用var.set方法改变var的值
#     global times
#     if times < 0:
#         return
#     m = times // 60
#     s = times % 60
#     var.set('{:0>2d}:{:0>2d}'.format(m, s))
#     times = times - 1
#     # 每隔1秒钟调用函数gettime自身获取时间
#     root.after(1000, gettime)
#
#
# root = Tk()
# root.title("倒计时")
# # 定义一个内部类型变量
# var = StringVar()
# # 用textvariable属性与变量var关联
# lb = Label(root, textvariable=var, fg='blue', font=('黑体', 40))
# lb.pack()
# gettime()
# root.mainloop()
#

# f=open("平凡的世界.txt",'r',encoding='utf-8')
# paper=f.read()
# before=input('孙少平')
# after=input('zzx')
# result=paper.replace(before,after)
# print(result[0:5000])
# f.close()

# import docx
# file=docx.Document()
# file.add_paragraph("床前明月光")
# file.save('静夜思.docx')

# import random
# a=random.randint(0,10)
# b=random.uniform(1,10)
# c=random.random()
# d='asdfgh'
# f=random.choice(d)
# print(f)
#
# import  random
# counts={}
# fobj=open('student.csv','r')
# for i in fobj:
#     name=i.strip()
#     counts[name]=random.randint(1,100)
#
# import random
# import matplotlib.pyplot as plt
# from wordcloud import WordCloud
# from imageio import imread
# pic = imread('LOVE.png')
# wc=WordCloud(mask=pic,font_path='msyh.ttc',  #中文字体
#              background_color='white', #设置背景颜色
#              max_words=80,           #设置最大词数
#              max_font_size=120,     #设置字体最大值
#              min_font_size=10,     #设置字体最小值
#              random_state=50,       #设置有多少种配色方案
#              scale=1)
# wc.generate_from_frequencies(counts)
# plt.imshow(wc)     #对图像进行处理，并显示其格式
# plt.show()
# wc.to_file('result.png')
#
# import jieba
# fobj=open('三国演义.txt','r',encoding='utf-8')
# txt=fobj.read()
# words=jieba.lcut(txt)
# counts={}
# print(words[0:10])
# for word in words:
#     if len(word)==1:
#         continue
#     else:
#         counts[word]=counts.get(word,0)+1
# items=list(counts.items())
# items.sort(key=lambda x:x[1],reverse=True)
# import matplotlib.pyplot as plt
# for i in range(15):
#     word,count=items[i]
#     x=word
#     y=count
#     print('{0:<10}{1:>5}'.format(word,count))
#     plt.bar(x,y)
# plt.show()


# from sympy import *#数学
# x=symbols('x')
# print(limit(sin(x)/x,x,0))
# print(limit(pow(1+1/x,x),x,00))
# print(integrate(sin(x)/x),(x,0,00))
# from sympy.abc import x,y


# from pylab import rc
# from sympy import *
# rc('font',size=16)
# #rc('text',usetex=True)
#
# x=symbols('x')  #构造符号变量
# y=sin(x)   #构造符号表达式
#
# for k in range(3,8,2):print(series(y,x,0,k))   #3,5,7
# #for k in range(3,8,2):print(y.series(x,0,k))
# plot(y,series(y,x,0,3).removeO(),series(y,x,0,5).removeO(),#去除尾数
#      series(y,x,0,7).removeO(),(x,0,2),xlabel='$x$',ylabel='$y$')


import numpy as np

# a = [1, 3, 2, 4, 5]
# b = np.array(a)
# print(b)
# b.sort()
# print(b)
# b = np.array([[1, 2, 3], [5, 6, 7]])
# print(b)

import matplotlib.pyplot as plt

# from numpy import sqrt
#
# x=np.linspace(-5,5,100)
# y=(1/sqrt(2*np.pi))*np.exp(-(x*x)/2)
# plt.plot(x,y,'-b')
# plt.show()
#
# t=np.linspace(0,7,8)
# y=[27.0,26.8,26.5,26.3,26.1,25.7,25.3,24.8]
# plt.plot(t,y,'*')
# plt.show()


import xlrd

from PIL import Image,ImageDraw,ImageFont
from pylab import subplot, imshow, show

a = Image.open('bg.jpg')
# b = a.resize((128, 256))
# c = b.convert('CMYK')
# subplot(121);
# imshow(a)
# subplot(122);
# imshow(b)
# show()

# a=Image.open('bg.jpg')
# b=Image.open('ss.jpg')
# print(a.size,b.size)
# c=b.resize((50,50))
# a.paste(c,(20,20))#粘贴位置
# a.show()

# ra,ga,ba=a.split()
# c=Image.merge('RGB',(ra,ga,ba))
# subplot(221);imshow(ra);subplot(222);imshow(ga)
# subplot(223);imshow(ba);subplot(224);imshow(c)
# show()

